package com.appheader.rongmaphone.adapter;

import android.annotation.SuppressLint;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.util.Log;

import com.appheader.rongmaphone.fragment.MyWebFragment;

import java.util.List;

/**
 * Created by zhep on 2016/11/2.
 */
public class StandardFragmentPagerAdapter extends FragmentPagerAdapter {

    private List<MyWebFragment> fragments;
//    private TextView text;
    public StandardFragmentPagerAdapter(FragmentManager fm, List<MyWebFragment> fragments) {
        super(fm);
        this.fragments = fragments;
//        this.text = text;
    }
    @SuppressLint("LongLogTag")
    @Override
    public long getItemId(int position) {
        Log.e("StandardFragmentPagerAdapter", "getItemId: "+position);
//        text.setText((position+1)+"");
        return super.getItemId(position);
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }
    @Override
    public int getCount() {
        return fragments.size();
    }
}
